#include "incs.h"

#include "EventSystem.h"
#include "StateListener.h"
#include "StateSystem.h"
#include "GameManager.h"

bool StateListener::HandleEvent( Event const & event )
{
	if(event.GetType() == EventType("ChangeStateEvent"))
	{
		EvtData<IGameState*> * ed = event.GetDataPtr< EvtData<IGameState*> >();
		IGameState * state = ed->GetValue();
		mGameMgr->ChangeState(state);
		return true;
	}
}